#ifndef STORAGESETTINGS_H
#define STORAGESETTINGS_H

#include <QtCore>

namespace CodeEdit {

/**
 * Settings that describes how the code editor behaves on saving.
 */
struct StorageSettings
{
    StorageSettings();

    void toSettings(QSettings *s) const;
    void fromSettings(QSettings *s);

    bool equals(const StorageSettings &ss) const;

    bool cleanWhitespace;  // Clean whitespace on saving?
    bool inEntireDocument; // Clean whitespace in entire document?
    bool cleanIndentation; // Clean whitespace in indentation?
    bool addFinalNewLine;  // Ensure new line at end of file?
};

inline bool operator==(const StorageSettings &ss1, const StorageSettings &ss2) { return ss1.equals(ss2); }
inline bool operator!=(const StorageSettings &ss1, const StorageSettings &ss2) { return !ss1.equals(ss2); }

} // namespace CodeEdit

#endif // STORAGESETTINGS_H
